package com.jwsoft.manager.core.dao.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 地址表
 *
 * @author chenzh
 * @since 2023-02-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("edu_address_history")
@Schema(name = "EduAddressHistory", title = "地址表", description = "地址表实体类")
public class EduAddressHistory extends Model<EduAddressHistory> {

    private static final long serialVersionUID = 1L;

    @Schema(name = "addressHistoryId", title = "地址id")
    @TableId(value = "address_history_id", type = IdType.ASSIGN_ID)
    private String addressHistoryId;

    @Schema(name = "year", title = "年度")
    @TableField(value = "year")
    private Integer year;

    @Schema(name = "addressId", title = "地址id")
    @TableField(value = "address_id")
    private String addressId;

    @Schema(name = "addressCode", title = "地址编码")
    @TableField(value = "address_code")
    private String addressCode;

    @Schema(name = "addressName", title = "地址名称")
    @TableField(value = "address_name")
    private String addressName;

    @Schema(name = "addressType", title = "地址类型 ")
    @TableField(value = "address_type")
    private String addressType;

    @Schema(name = "fiexed", title = "是否可编辑 0 否 1 是")
    @TableField(value = "fiexed")
    private String fiexed;

    @Schema(name = "fictitious", title = "是否虚拟 0 否 1 是")
    @TableField(value = "fictitious")
    private String fictitious;

    @Schema(name = "contact", title = "联系人")
    @TableField(value = "contact")
    private String contact;

    @Schema(name = "cellphone", title = "联系人手机")
    @TableField(value = "cellphone")
    private String cellphone;

    @Schema(name = "phone", title = "联系人电话")
    @TableField(value = "phone")
    private String phone;

    @Schema(name = "rate", title = "级别")
    @TableField(value = "rate")
    private Integer rate;

    @Schema(name = "orderNo", title = "排序号")
    @TableField(value = "order_no")
    private Integer orderNo;

    @Schema(name = "parentId", title = "父级地址编码")
    @TableField(value = "parent_id")
    private String parentId;

    @Schema(name = "parentPath", title = "父级完整地址")
    @TableField(value = "parent_path")
    private String parentPath;

    @Schema(name = "longitude", title = "经度")
    @TableField(value = "longitude")
    private BigDecimal longitude;

    @Schema(name = "latitude", title = "纬度")
    @TableField(value = "latitude")
    private BigDecimal latitude;

    @Schema(name = "remarks", title = "描述")
    @TableField(value = "remarks")
    private String remarks;

    @Schema(name = "status", title = "状态")
    @TableField(value = "status")
    private String status;

    @Schema(name = "del", title = "0,未删除,1,已删除")
    @TableField(value = "del", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @Schema(name = "createName", title = "创建人")
    @TableField(value = "create_name", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @Schema(name = "createTime", title = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @Schema(name = "updateName", title = "修改人")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @Schema(name = "updateTime", title = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @Schema(name = "handleStatus", title = "地址分解状态：0 未处理 1 处理成功 2 处理失败")
    @TableField(value = "handle_status")
    private String handleStatus;

    @Schema(name = "handleTime", title = "处理时间")
    @TableField(value = "handle_time")
    private Date handleTime;

    @Schema(name = "handleMessage", title = "处理结果信息")
    @TableField(value = "handle_message")
    private String handleMessage;

    @Schema(name = "authStatus", title = "审核状态")
    @TableField(value = "auth_Status")
    private String authStatus;

    @Schema(name = "authRemarks", title = "审核意见")
    @TableField(value = "auth_remarks")
    private String authRemarks;

    @Schema(name = "authTime", title = "审核时间")
    @TableField(value = "auth_time")
    private Date authTime;

    @Schema(name = "authUserId", title = "审核人")
    @TableField(value = "auth_user_id")
    private String authUserId;

    @Schema(name = "addressTreeId", title = "对应edu_address_tree表的叶子节点address_id")
    @TableField(value = "address_tree_id")
    private Long addressTreeId;

    @Schema(name = "matchingStatus", title = "是否匹配学区 0 未匹配 1已匹配成功")
    @TableField(value = "matching_status")
    private String matchingStatus;

    @Schema(name = "matchingTime", title = "自动匹配学区时间")
    @TableField(value = "matching_time")
    private Date matchingTime;

    @Schema(name = "matchingMessage", title = "匹配学区处理结果信息")
    @TableField(value = "matching_message")
    private String matchingMessage;

    @Schema(name = "locationStatus", title = "是否匹配经纬度 0 未匹配 1已匹配成功 2匹配失败")
    @TableField(value = "location_status")
    private String locationStatus;

    @Schema(name = "locationTime", title = "匹配经纬度时间")
    @TableField(value = "location_time")
    private Date locationTime;

    @Schema(name = "locationMessage", title = "匹配经纬度处理结果信息")
    @TableField(value = "location_message")
    private String locationMessage;

    @Override
    public Serializable pkVal() {
        return this.addressHistoryId;
    }
}
